﻿using EFModel;
using IServices;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Y2.Dao;
using Y2.Filters;

namespace Y2.Controllers
{
    [LoginFilter]
    public class config_file_second_kindController : Controller
    {
        private readonly Iconfig_file_second_kind he;

        public config_file_second_kindController(Iconfig_file_second_kind he)
        {
            this.he = he;
        }

        public IActionResult config_file_second_kind()
        {
            return View();
        }

        public async Task<IActionResult> Index4(int currentPage, int pageSize)
        {
            return Content(JsonConvert.SerializeObject(await he.Index4(currentPage, pageSize)));
        }

        public async Task<string> Inde1()
        {
            return await he.Inde1();
        }

        public async Task<int> Inser1(string first_kind_id, string first_kind_name, string second_kind_id, string second_kind_name, string second_salary_id, string second_sale_id)
        {
            return await he.Inser1(first_kind_id, first_kind_name, second_kind_id, second_kind_name, second_salary_id, second_sale_id);
        }

        public async Task<int> Updat1(int fsk_id, string first_kind_id, string first_kind_name, string second_kind_id, string second_kind_name, string second_salary_id, string second_sale_id)
        {
            return await he.Updat1(fsk_id, first_kind_id, first_kind_name, second_kind_id, second_kind_name, second_salary_id, second_sale_id);
        }

        public async Task<int> delt1(int id)
        {
            return await he.delt1(id);
        }
    }
}
